Survey Methodology II
2024-03-20
Cleaning data
Tidy data
Joining datasets (World Bank Data | Trans Rights Indicator Project)
- Campbell, M., Hinton, J. D. X. & Anderson, J. R. (2019) A systematic review of the relationship between religion and attitudes toward transgender and gender-variant people. International Journal of Transgenderism, 20:1, 21-38, DOI: 10.1080/15532739.2018.1545149
- Earle, M. et al. (2021). A multilevel analysis of LGBT (Lesbian, Gay, Bisexual, Transgender) rights support across 77 countries: The role of contact and country laws . British Journal of Social Psychology. doi:10.1111/bjso.12436
- Flores, A. R. (2015) Attitudes toward transgender rights: perceived knowledge and secondary interpersonal contact, Politics, Groups, and Identities, 3:3, 398-416, DOI: 10.1080/21565503.2015.1050414-
- Flores, A. R., Brown, T. N. T., & Park, A. S. (2016). Public Support for Transgender Rights: A Twenty-three Country Survey. The Williams Institute at UCLA School of Law. <http://www.jstor.org/stable/resrep34965->
- Harrison, B.F., Michelson, M.R. (2019) Gender, Masculinity Threat, and Support for Transgender Rights: An Experimental Study. Sex Roles 80, 63–75. <https://doi.org/10.1007/s11199-018-0916-6>
- Norton, A.T., Herek, G.M. (2013) Heterosexuals’ Attitudes Toward Transgender People: Findings from a National Probability Sample of U.S. Adults. Sex Roles 68, 738–753.
Cell Contents
|-------------------------|
| Count |
| Row Percent |
| Column Percent |
| Total Percent |
| Adj Std Resid |
|-------------------------|
Total Observations in Table: 27438
| df_descriptive$qc19_multinominal
df_descriptive$sd3_cat | Yes | No | Don't know | Row Total |
-----------------------|------------|------------|------------|------------|
Atheist | Agnostic | 3860 | 1458 | 485 | 5803 |
| 66.52% | 25.12% | 8.36% | 21.15% |
| 26.69% | 15.04% | 14.79% | |
| 14.07% | 5.31% | 1.77% | |
| 23.72 | -18.32 | -9.51 | |
-----------------------|------------|------------|------------|------------|
Catholic | 5605 | 4241 | 1352 | 11198 |
| 50.05% | 37.87% | 12.07% | 40.81% |
| 38.75% | 43.74% | 41.22% | |
| 20.43% | 15.46% | 4.93% | |
| -7.32 | 7.30 | 0.51 | |
-----------------------|------------|------------|------------|------------|
Don't know | Refusal | 191 | 175 | 117 | 483 |
| 39.54% | 36.23% | 24.22% | 1.76% |
| 1.32% | 1.81% | 3.57% | |
| 0.70% | 0.64% | 0.43% | |
| -5.85 | 0.42 | 8.39 | |
-----------------------|------------|------------|------------|------------|
Jewish | 34 | 21 | 3 | 58 |
| 58.62% | 36.21% | 5.17% | 0.21% |
| 0.24% | 0.22% | 0.09% | |
| 0.12% | 0.08% | 0.01% | |
| 0.90 | 0.14 | -1.59 | |
-----------------------|------------|------------|------------|------------|
Muslim | 159 | 160 | 73 | 392 |
| 40.56% | 40.82% | 18.62% | 1.43% |
| 1.10% | 1.65% | 2.23% | |
| 0.58% | 0.58% | 0.27% | |
| -4.85 | 2.29 | 4.10 | |
-----------------------|------------|------------|------------|------------|
Orthodox Christian | 1421 | 1959 | 636 | 4016 |
| 35.38% | 48.78% | 15.84% | 14.64% |
| 9.83% | 20.21% | 19.39% | |
| 5.18% | 7.14% | 2.32% | |
| -23.81 | 19.29 | 8.21 | |
-----------------------|------------|------------|------------|------------|
Other | 730 | 425 | 119 | 1274 |
| 57.30% | 33.36% | 9.34% | 4.64% |
| 5.05% | 4.38% | 3.63% | |
| 2.66% | 1.55% | 0.43% | |
| 3.36 | -1.51 | -2.94 | |
-----------------------|------------|------------|------------|------------|
Other Christian | 597 | 449 | 137 | 1183 |
| 50.46% | 37.95% | 11.58% | 4.31% |
| 4.13% | 4.63% | 4.18% | |
| 2.18% | 1.64% | 0.50% | |
| -1.58 | 1.93 | -0.40 | |
-----------------------|------------|------------|------------|------------|
Protestant | 1866 | 807 | 358 | 3031 |
| 61.56% | 26.62% | 11.81% | 11.05% |
| 12.90% | 8.32% | 10.91% | |
| 6.80% | 2.94% | 1.30% | |
| 10.35 | -10.64 | -0.26 | |
-----------------------|------------|------------|------------|------------|
Column Total | 14463 | 9695 | 3280 | 27438 |
| 52.71% | 35.33% | 11.95% | |
-----------------------|------------|------------|------------|------------|
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 1200.107 d.f. = 16 p = 1.412899e-245
Minimum expected frequency: 6.93345
Df Sum Sq Mean Sq F value Pr(>F)
qc19_multinominal 2 111437 55719 171.1 <2e-16 ***
Residuals 27435 8936216 326
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
df_country_2 <-
df_descriptive |>
mutate(qc1_8_ordinal = case_when(
qc1_8_ordinal == "Very wide spread" ~ "Very or fairly wide spread",
qc1_8_ordinal == "Fairly wide spread" ~ "Very or fairly wide spread",
TRUE ~ qc1_8_ordinal
)) |>
group_by(country_name) |>
summarize(
prop_dis_wide = (sum(qc1_8_ordinal == "Very or fairly wide spread") / n())*100,
prop_qc19_yes = (sum(qc19 == 1) / n())*100)
cor(df_country_2$prop_dis_wide, df_country_2$prop_qc19_yes, method = "spearman")[1] 0.4738916
Cell Contents
|-------------------------|
| Count |
| Row Percent |
| Column Percent |
| Total Percent |
| Adj Std Resid |
|-------------------------|
Total Observations in Table: 27438
| df_descriptive$qc19_multinominal
df_descriptive$qc15_1_ordinal | Yes | No | Don't know | Row Total |
------------------------------|------------|------------|------------|------------|
Totally agree | 8494 | 1806 | 776 | 11076 |
| 76.69% | 16.31% | 7.01% | 40.37% |
| 58.73% | 18.63% | 23.66% | |
| 30.96% | 6.58% | 2.83% | |
| 65.45 | -54.25 | -20.79 | |
------------------------------|------------|------------|------------|------------|
Tend to agree | 3949 | 2458 | 948 | 7355 |
| 53.69% | 33.42% | 12.89% | 26.81% |
| 27.30% | 25.35% | 28.90% | |
| 14.39% | 8.96% | 3.46% | |
| 1.97 | -4.02 | 2.89 | |
------------------------------|------------|------------|------------|------------|
Tend to disagree | 1042 | 2297 | 438 | 3777 |
| 27.59% | 60.82% | 11.60% | 13.77% |
| 7.20% | 23.69% | 13.35% | |
| 3.80% | 8.37% | 1.60% | |
| -33.30 | 35.28 | -0.73 | |
------------------------------|------------|------------|------------|------------|
Totally disagree | 690 | 2636 | 458 | 3784 |
| 18.23% | 69.66% | 12.10% | 13.79% |
| 4.77% | 27.19% | 13.96% | |
| 2.51% | 9.61% | 1.67% | |
| -45.75 | 47.58 | 0.31 | |
------------------------------|------------|------------|------------|------------|
Don't know | 288 | 498 | 660 | 1446 |
| 19.92% | 34.44% | 45.64% | 5.27% |
| 1.99% | 5.14% | 20.12% | |
| 1.05% | 1.82% | 2.41% | |
| -25.66 | -0.73 | 40.57 | |
------------------------------|------------|------------|------------|------------|
Column Total | 14463 | 9695 | 3280 | 27438 |
| 52.71% | 35.33% | 11.95% | |
------------------------------|------------|------------|------------|------------|
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 7514.449 d.f. = 8 p = 0
Minimum expected frequency: 172.8581
df_country_3 <-
df_descriptive |>
mutate(qc15_1_ordinal = case_when(
qc15_1_ordinal == "Totally agree" ~ "Totally or tend to agree",
qc15_1_ordinal == "Tend to agree" ~ "Totally or tend to agree",
TRUE ~ qc15_1_ordinal
)) |>
group_by(country_name) |>
summarize(
prop_lgb_yes = (sum(qc15_1_ordinal == "Totally or tend to agree") / n())*100,
prop_qc19_yes = (sum(qc19 == 1) / n())*100)
cor(df_country_3$prop_lgb_yes, df_country_3$prop_qc19_yes, method = "spearman")[1] 0.8768473
Cell Contents
|-------------------------|
| Count |
| Row Percent |
| Column Percent |
| Total Percent |
| Adj Std Resid |
|-------------------------|
Total Observations in Table: 27316
| df_descriptive$qc19_multinominal
df_descriptive$adp_general | Yes | No | Don't know | Row Total |
---------------------------|------------|------------|------------|------------|
0 | 5472 | 4487 | 1734 | 11693 |
| 46.80% | 38.37% | 14.83% | 42.81% |
| 38.05% | 46.43% | 53.03% | |
| 20.03% | 16.43% | 6.35% | |
| -16.75 | 8.94 | 12.59 | |
---------------------------|------------|------------|------------|------------|
1 | 8909 | 5178 | 1536 | 15623 |
| 57.02% | 33.14% | 9.83% | 57.19% |
| 61.95% | 53.57% | 46.97% | |
| 32.61% | 18.96% | 5.62% | |
| 16.75 | -8.94 | -12.59 | |
---------------------------|------------|------------|------------|------------|
Column Total | 14381 | 9665 | 3270 | 27316 |
| 52.65% | 35.38% | 11.97% | |
---------------------------|------------|------------|------------|------------|
Statistics for All Table Factors
Pearson's Chi-squared test
------------------------------------------------------------
Chi^2 = 324.114 d.f. = 2 p = 4.164315e-71
Minimum expected frequency: 1399.77
serialid country_name binary_qc19 male
Mode :logical Mode :logical Mode :logical Mode :logical
FALSE:27438 FALSE:27438 FALSE:24158 FALSE:27438
TRUE :3280
d11 Cat_age_four Cat_age_six Cat_age_seven
Mode :logical Mode :logical Mode :logical Mode :logical
FALSE:27438 FALSE:27438 FALSE:27438 FALSE:27438
political_ideology Religion_cat sd1_7_factor age_stopped_education
Mode :logical Mode :logical Mode :logical Mode :logical
FALSE:22749 FALSE:27438 FALSE:27438 FALSE:25375
TRUE :4689 TRUE :2063
d60_ordinal sd2_5 area_type qc15_1_ordinal
Mode :logical Mode :logical Mode :logical Mode :logical
FALSE:27059 FALSE:27438 FALSE:27424 FALSE:27438
TRUE :379 TRUE :14
iter imp variable
1 1 age_stopped_education
1 2 age_stopped_education
1 3 age_stopped_education
1 4 age_stopped_education
1 5 age_stopped_education
2 1 age_stopped_education
2 2 age_stopped_education
2 3 age_stopped_education
2 4 age_stopped_education
2 5 age_stopped_education
3 1 age_stopped_education
3 2 age_stopped_education
3 3 age_stopped_education
3 4 age_stopped_education
3 5 age_stopped_education
4 1 age_stopped_education
4 2 age_stopped_education
4 3 age_stopped_education
4 4 age_stopped_education
4 5 age_stopped_education
5 1 age_stopped_education
5 2 age_stopped_education
5 3 age_stopped_education
5 4 age_stopped_education
5 5 age_stopped_education
iter imp variable
1 1 age_stopped_education
1 2 age_stopped_education
1 3 age_stopped_education
1 4 age_stopped_education
1 5 age_stopped_education
2 1 age_stopped_education
2 2 age_stopped_education
2 3 age_stopped_education
2 4 age_stopped_education
2 5 age_stopped_education
3 1 age_stopped_education
3 2 age_stopped_education
3 3 age_stopped_education
3 4 age_stopped_education
3 5 age_stopped_education
4 1 age_stopped_education
4 2 age_stopped_education
4 3 age_stopped_education
4 4 age_stopped_education
4 5 age_stopped_education
5 1 age_stopped_education
5 2 age_stopped_education
5 3 age_stopped_education
5 4 age_stopped_education
5 5 age_stopped_education
iter imp variable
1 1 age_stopped_education
1 2 age_stopped_education
1 3 age_stopped_education
1 4 age_stopped_education
1 5 age_stopped_education
2 1 age_stopped_education
2 2 age_stopped_education
2 3 age_stopped_education
2 4 age_stopped_education
2 5 age_stopped_education
3 1 age_stopped_education
3 2 age_stopped_education
3 3 age_stopped_education
3 4 age_stopped_education
3 5 age_stopped_education
4 1 age_stopped_education
4 2 age_stopped_education
4 3 age_stopped_education
4 4 age_stopped_education
4 5 age_stopped_education
5 1 age_stopped_education
5 2 age_stopped_education
5 3 age_stopped_education
5 4 age_stopped_education
5 5 age_stopped_education
iter imp variable
1 1 age_stopped_education
1 2 age_stopped_education
1 3 age_stopped_education
1 4 age_stopped_education
1 5 age_stopped_education
2 1 age_stopped_education
2 2 age_stopped_education
2 3 age_stopped_education
2 4 age_stopped_education
2 5 age_stopped_education
3 1 age_stopped_education
3 2 age_stopped_education
3 3 age_stopped_education
3 4 age_stopped_education
3 5 age_stopped_education
4 1 age_stopped_education
4 2 age_stopped_education
4 3 age_stopped_education
4 4 age_stopped_education
4 5 age_stopped_education
5 1 age_stopped_education
5 2 age_stopped_education
5 3 age_stopped_education
5 4 age_stopped_education
5 5 age_stopped_education
glm_model_2 <- glmer(binary_qc19 ~ male + d11 + I(d11^2) + political_ideology +
Religion_cat + sd1_7_factor + d60_ordinal + qc15_1_ordinal +
prop_gndr_bin + prop_dis_wide + Unemployment + (1 | country_name),
data = Data, family = binomial,
control = glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000)))
summary(glm_model_2)Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula:
binary_qc19 ~ male + d11 + I(d11^2) + political_ideology + Religion_cat +
sd1_7_factor + d60_ordinal + qc15_1_ordinal + prop_gndr_bin +
prop_dis_wide + Unemployment + (1 | country_name)
Data: Data
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 1e+05))
AIC BIC logLik deviance df.resid
20435.5 20704.5 -10183.7 20367.5 20171
Scaled residuals:
Min 1Q Median 3Q Max
-6.4039 -0.6105 0.3309 0.5685 5.9159
Random effects:
Groups Name Variance Std.Dev.
country_name (Intercept) 0.1296 0.3601
Number of obs: 20205, groups: country_name, 28
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.234e-01 3.009e-01 1.075 0.28248
male -3.591e-01 3.530e-02 -10.173 < 2e-16 ***
d11 2.836e-02 5.113e-03 5.546 2.92e-08 ***
I(d11^2) -3.173e-04 4.961e-05 -6.395 1.60e-10 ***
political_ideology2 7.860e-02 1.162e-01 0.676 0.49893
political_ideology3 -2.507e-02 9.271e-02 -0.270 0.78685
political_ideology4 -1.105e-01 9.139e-02 -1.209 0.22674
political_ideology5 -1.462e-01 7.873e-02 -1.857 0.06335 .
political_ideology6 -2.897e-01 8.956e-02 -3.234 0.00122 **
political_ideology7 -5.223e-01 8.990e-02 -5.810 6.24e-09 ***
political_ideology8 -5.675e-01 9.180e-02 -6.182 6.32e-10 ***
political_ideology9 -5.556e-01 1.229e-01 -4.522 6.11e-06 ***
political_ideologyRight -1.360e-01 9.752e-02 -1.395 0.16303
Religion_catCatholic -2.401e-01 5.519e-02 -4.350 1.36e-05 ***
Religion_catJewish 2.438e-01 3.699e-01 0.659 0.50983
Religion_catMuslim -7.643e-01 1.583e-01 -4.827 1.39e-06 ***
Religion_catOrthodox Christian -2.567e-01 9.259e-02 -2.772 0.00557 **
Religion_catOther -2.329e-01 1.799e-01 -1.295 0.19538
Religion_catOther Christian -4.322e-01 9.184e-02 -4.706 2.52e-06 ***
Religion_catOther Religion -2.094e-01 8.803e-02 -2.379 0.01737 *
Religion_catProtestant -1.982e-01 7.172e-02 -2.763 0.00572 **
sd1_7_factorNo -6.139e-01 6.735e-02 -9.114 < 2e-16 ***
sd1_7_factorRefusal (SPONTANEOUS) -8.757e-01 1.730e-01 -5.063 4.12e-07 ***
sd1_7_factorDon't know -5.918e-01 1.226e-01 -4.827 1.39e-06 ***
d60_ordinalFrom time to time 1.609e-01 7.497e-02 2.147 0.03181 *
d60_ordinalAlmost never/ never 3.073e-01 7.239e-02 4.246 2.18e-05 ***
qc15_1_ordinalTend to agree -8.462e-01 4.518e-02 -18.730 < 2e-16 ***
qc15_1_ordinalTend to disagree -1.922e+00 5.607e-02 -34.276 < 2e-16 ***
qc15_1_ordinalTotally disagree -2.359e+00 6.343e-02 -37.195 < 2e-16 ***
qc15_1_ordinalDon't know -1.745e+00 1.023e-01 -17.059 < 2e-16 ***
prop_gndr_bin 4.360e+00 5.621e-01 7.757 8.72e-15 ***
prop_dis_wide -1.731e+00 7.264e-01 -2.383 0.01718 *
Unemployment 6.801e-02 2.575e-02 2.641 0.00825 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
fit warnings:
Some predictor variables are on very different scales: consider rescaling
optimizer (bobyqa) convergence code: 0 (OK)
Model failed to converge with max|grad| = 5.51108 (tol = 0.002, component 1)
Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
Model is nearly unidentifiable: large eigenvalue ratio
- Rescale variables?
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula:
binary_qc19 ~ male + d11 + I(d11^2) + political_ideology + Religion_cat +
sd1_7_factor + d60_ordinal + qc15_1_ordinal + prop_gndr_bin +
prop_dis_wide + Unemployment + (1 | country_name)
Data: Data
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 1e+05))
AIC BIC logLik deviance df.resid
20435.4 20704.5 -10183.7 20367.4 20171
Scaled residuals:
Min 1Q Median 3Q Max
-6.4121 -0.6099 0.3306 0.5684 5.9261
Random effects:
Groups Name Variance Std.Dev.
country_name (Intercept) 0.1296 0.3601
Number of obs: 20205, groups: country_name, 28
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.34662 0.29782 4.522 6.14e-06 ***
male -0.35962 0.03531 -10.184 < 2e-16 ***
d11 -0.07900 0.01901 -4.154 3.26e-05 ***
I(d11^2) -0.10476 0.01764 -5.940 2.85e-09 ***
political_ideology2 0.07867 0.11626 0.677 0.49861
political_ideology3 -0.02515 0.09271 -0.271 0.78618
political_ideology4 -0.11063 0.09139 -1.211 0.22608
political_ideology5 -0.14640 0.07873 -1.860 0.06294 .
political_ideology6 -0.29011 0.08956 -3.239 0.00120 **
political_ideology7 -0.52307 0.08990 -5.819 5.93e-09 ***
political_ideology8 -0.56836 0.09179 -6.192 5.95e-10 ***
political_ideology9 -0.55645 0.12286 -4.529 5.92e-06 ***
political_ideologyRight -0.13621 0.09752 -1.397 0.16251
Religion_catCatholic -0.24032 0.05520 -4.354 1.34e-05 ***
Religion_catJewish 0.24430 0.36967 0.661 0.50869
Religion_catMuslim -0.76532 0.15838 -4.832 1.35e-06 ***
Religion_catOrthodox Christian -0.25704 0.09260 -2.776 0.00551 **
Religion_catOther -0.23312 0.17988 -1.296 0.19497
Religion_catOther Christian -0.43283 0.09186 -4.712 2.46e-06 ***
Religion_catOther Religion -0.20965 0.08805 -2.381 0.01726 *
Religion_catProtestant -0.19850 0.07174 -2.767 0.00566 **
sd1_7_factorNo -0.61464 0.06737 -9.123 < 2e-16 ***
sd1_7_factorRefusal (SPONTANEOUS) -0.87691 0.17298 -5.069 3.99e-07 ***
sd1_7_factorDon't know -0.59260 0.12264 -4.832 1.35e-06 ***
d60_ordinalFrom time to time 0.16122 0.07498 2.150 0.03154 *
d60_ordinalAlmost never/ never 0.30780 0.07240 4.251 2.12e-05 ***
qc15_1_ordinalTend to agree -0.84747 0.04519 -18.754 < 2e-16 ***
qc15_1_ordinalTend to disagree -1.92485 0.05608 -34.321 < 2e-16 ***
qc15_1_ordinalTotally disagree -2.36292 0.06346 -37.237 < 2e-16 ***
qc15_1_ordinalDon't know -1.74741 0.10228 -17.084 < 2e-16 ***
prop_gndr_bin 4.37162 0.56045 7.800 6.18e-15 ***
prop_dis_wide -1.73790 0.72437 -2.399 0.01643 *
Unemployment 0.22144 0.08377 2.643 0.00821 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Results of GLMM Analysis
=============================================================
Dependent variable:
---------------------------
binary_qc19
-------------------------------------------------------------
male -0.360***
(0.035)
d11 -0.079***
(0.019)
I(d112) -0.105***
(0.018)
political_ideology2 0.079
(0.116)
political_ideology3 -0.025
(0.093)
political_ideology4 -0.111
(0.091)
political_ideology5 -0.146*
(0.079)
political_ideology6 -0.290***
(0.090)
political_ideology7 -0.523***
(0.090)
political_ideology8 -0.568***
(0.092)
political_ideology9 -0.556***
(0.123)
political_ideologyRight -0.136
(0.098)
Religion_catCatholic -0.240***
(0.055)
Religion_catJewish 0.244
(0.370)
Religion_catMuslim -0.765***
(0.158)
Religion_catOrthodox Christian -0.257***
(0.093)
Religion_catOther -0.233
(0.180)
Religion_catOther Christian -0.433***
(0.092)
Religion_catOther Religion -0.210**
(0.088)
Religion_catProtestant -0.199***
(0.072)
sd1_7_factorNo -0.615***
(0.067)
sd1_7_factorRefusal (SPONTANEOUS) -0.877***
(0.173)
sd1_7_factorDon't know -0.593***
(0.123)
d60_ordinalFrom time to time 0.161**
(0.075)
d60_ordinalAlmost never/ never 0.308***
(0.072)
qc15_1_ordinalTend to agree -0.847***
(0.045)
qc15_1_ordinalTend to disagree -1.925***
(0.056)
qc15_1_ordinalTotally disagree -2.363***
(0.063)
qc15_1_ordinalDon't know -1.747***
(0.102)
prop_gndr_bin 4.372***
(0.560)
prop_dis_wide -1.738**
(0.724)
Unemployment 0.221***
(0.084)
Constant 1.347***
(0.298)
-------------------------------------------------------------
Observations 20,205
Log Likelihood -10,183.720
Akaike Inf. Crit. 20,435.440
Bayesian Inf. Crit. 20,704.510
=============================================================
Note: *p<0.1; **p<0.05; ***p<0.01
[1] 20435.44
[1] 20704.51
We aim to build a model to predict support for transgender individuals to change legal documents.
Model = binary_qc19 ~ male + d11 + I(d11^2) + political_ideology + Religion_cat + sd1_7_factor + d60_ordinal + qc15_1_ordinal + Unemployment + prop_gndr_bin + prop_dis_wide
Confusion Matrix and Statistics
Reference
Prediction No Yes
No 1172 597
Yes 409 1902
Accuracy : 0.7534
95% CI : (0.7399, 0.7666)
No Information Rate : 0.6125
P-Value [Acc > NIR] : < 2.2e-16
Kappa : 0.4917
Mcnemar's Test P-Value : 3.729e-09
Sensitivity : 0.7413
Specificity : 0.7611
Pos Pred Value : 0.6625
Neg Pred Value : 0.8230
Prevalence : 0.3875
Detection Rate : 0.2873
Detection Prevalence : 0.4336
Balanced Accuracy : 0.7512
'Positive' Class : No
The selected predictive model for our international analysis is Gradient Boosting (GB).
GB not only has one of the highest Accuracy levels but also achieves the most balanced rates of Specificity and Sensitivity. Such a robust performance profile makes it the optimal choice for our data set.
We found that this model, is the most adept and effective at predicting whether countries will support the right of transgender individuals to change their civil documents.